package com.hxd.mall.module.product.search.history

import com.hxd.mall.network.base.BaseRequest
import com.hxd.mall.network.service.IMeFunctionApi
import com.hxd.mall.network.service.ManagerFunctionApi
import com.hxd.mall.network.service.ManagerFunctionApi.mIConfigureFunctionApi
import com.hxd.mall.utils.open.ToastUtil
import javax.inject.Inject

/**
 * @author zhaoyong
 * @description:
 * @date :2019/7/17 11:08 AM
 */
class SearchHistoryPresenter @Inject constructor(view: ISearchHistoryView) :   ISearchHistoryPresenter {
    private var mView: ISearchHistoryView = view

    override fun getData(isRefresh: Boolean) {
    }

    override fun getData() {
        BaseRequest.request(mIConfigureFunctionApi.searchHotsData(), {
            mView.finishRefresh()
            mView.showData(it)
        }, {
            mView.finishRefresh()
            ToastUtil.showToast(it.msg ?: "")
        })
    }

    override fun getVersionInfo() {
    }
}